<template>
    <view>
        <view class="cu-card case">
			<view class="cu-item shadow bg-white padding" >
				<view class="flex justify-center round">
					<view class="cuIcon-safe text-green" style="font-size: 50px;"></view>
				</view>
				<view class="flex justify-center">
					<view>登录记录</view>
				</view>
				
			</view>
			<view class="cu-item shadow bg-white" >
				<view class="cu-bar shadow bg-white" v-for="(item,index) in list" :key="index">
				    <view class="padding" style="font-size: 15px;">登录时间：{{item}}</view>
				</view>
			</view>

      </view>
  </view>
</template>

<script>
import moment from "moment";
moment.locale("zh-cn");
export default {
	data(){
	    return{
	        list:[],
	    }
	},
    mounted(){
        this.getList();
		console.log(this.list);
    },
    methods:{
        getList(){
            this.request({
                url:this.apiServer + "/user/findUserLoginHistoryById?id="+uni.getStorageSync("user").id
            }).then(res=>{
				if(res.code==0&&res.data!=null)
				res.data.forEach((v,index)=>{
					this.list.push(moment(v).format('YYYY-MM-DD HH:mm:ss')); 					
				});
            });
        }
    },

}
</script>

<style >

</style>